There is a tendency for cache memories to have a larger capacity, along with which there is a problem of increase in leakage current of the cache memories. MRAMs (Magnetoresistive RAMS) attract attention as a candidate for a large-capacity cache memory are non-volatile. MRAMs have a feature of much smaller leakage current than SRAMs currently used in the cache memories.
Spin injection magnetization inversion is one of MRAM data writing techniques. In the spin injection magnetization inversion, a write current having a specific current value or larger flows into a magnetic tunnel junction element (MTJ element) of an MRAM. Also in data reading, a specific read current flows into the MTJ element.
The current value of a write current for spin injection MRAMs is set to be equal or larger than an inversion threshold value at which spin injection causes magnetization inversion. The current value of a read current for the spin injection MRAMs is set to be smaller than the inversion threshold value.
However, due to characteristic variation in a plurality of MTJ elements of an MRAM, the inversion threshold value varies for each MTJ element. Moreover, when data is repeatedly written in the same MTJ element, the inversion threshold value for the MTJ element becomes unstable.
The above-described drawbacks may cause several problems such as write errors in data writing, read disturb originated in a read current in data reading, magnetization inversion due to thermal agitation in data retention, and retention failure.
One proposal to deal with these failures is an MRAM provided with an ECC (Error Correction and Coding) circuitry for error correction in data reading. Another proposed technique is to rewrite data with a long write pulse width when an error is detected. However, the write pulse width is adjusted to be longer for rewriting after an error is detected, which causes a longer average latency in accessing an MRAM.